package com.vc.demo.model;

public class OpenResult extends RestResult {

    private String requestId;

    private String signature;

    private String encryptedRandomKey;

    public OpenResult(String requestId, RestResult rr) {
        this.requestId = requestId;
        this.setCode(rr.getCode());
        this.setSuccess(rr.getSuccess());
        this.setData(rr.getData());
        this.setMessage(rr.getMessage());
    }

    public static OpenResult success(String requestId, Object data) {
        return new OpenResult(requestId, RestResult.success(data));
    }

    public static OpenResult failed(String requestId, String code, String message) {
        return new OpenResult(requestId, RestResult.error(code, message));
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public String getSignature() {
        return signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }

    public String getEncryptedRandomKey() {
        return encryptedRandomKey;
    }

    public void setEncryptedRandomKey(String encryptedRandomKey) {
        this.encryptedRandomKey = encryptedRandomKey;
    }
}
